class UpperAttrMetaClass(type):
    def __new__(cls, class_name, class_patterns, class_attr, **kwargs):
        new_attr = {}
        for name, value in class_attr.items():
            if not name.startswith('__'):
                new_attr[name.upper()] = value

        return type(class_name, class_patterns, new_attr)


class my_class(object, metaclass=UpperAttrMetaClass):
    bar = 'bip'


obj = my_class()
print(obj.BAR)